package com.access.boot.autoconfigure.apisdk.context;

import com.access.boot.apisdk.SdkContext;

/**
 * @author Yangzhen
 * @date 2022/6/5 11:31
 * @since 1.0.0
 */
public class SdkContextExpired {

    private SdkContext sdkContext;

    private Long expire;

    public SdkContextExpired(SdkContext sdkContext) {
        this.sdkContext = sdkContext;
        expire = System.currentTimeMillis();
    }

    public SdkContext getSdkContext() {
        return sdkContext;
    }

    public boolean hasExpired() {
        long current = System.currentTimeMillis();
        return (current - expire) > 30 * 60 * 1000;
    }
}
